# README #

This is README for the replication files for:

Erlich, Aaron, and Calvin Garner. 2018. “Interpersonal Incomparability in Citizens’ Views of Democracy: Survey Evidence from Ukraine.” *Journal of Elections, Public Opinion and Parties*: 1–22.
.

### What is this repository for? ###

* The repository is for documenting the data analysis and visualizations associated with this article.

### How do I get set up? ###

* To replicate the analysis found in the paper, `packrat::unbundle()` the `packrat` project and  open  `r_code.Rproj`  in RStudio; then run/source the script `master.R` and then run the functions `run_replication()`. There are a couple of options for this file. You can see them and change accordingly. All of the data files need to be put in a separate directory outside of the code directory called `clean_data`.

All of the tables and figures output to two separate directories `../anchor_paper_images/` and `../anchor_paper_tables.` The Bayesian Aldrich-McKelvey (BAM) analysis needs to be run separately from `bam_master.R`. But the data are already present for you as well. That is, all of these analyses are saved, so they do not need to be re-run to get the main tables from the paper. 

There are two distinct processes that `run_replication()` executes. The first is the data/variable recoding and vignette correction process. It takes the original data and writes a new csv.

The second set of scripts that are in `master.R call` in the csv of the recoded and corrected data; essentially, they use the output of the recode/correct scripts, but you don't need to run those every time. These scripts generate plots and tables and run the imputations.

We have used `packrat` to snapshot all the libraries we used so, this should work without downloading anything.  You can see the `/packrat/packrat.lock` file to see the libraries and versions used for the analysis. 

### Who do I talk to? ###

* aaron.erlich@gmail.com or calvin.h.garner@gmail.com
